home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TeX 1995 July
/
TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO
/
tex-k
/
tex-k-archive.past
/
1994.12.gz
/
1994.12
/
000112_mackay@cs.washington.edu_Wed Dec 28 04:10:39 1994.msg
< prev
next >
Wrap
Internet Message Format
|
1994-12-30
|
6KB
Received: from june.cs.washington.edu by cs.umb.edu with SMTP id AA24074
(5.65c/IDA-1.4.4 for <tex-k@cs.umb.edu>); Wed, 28 Dec 1994 15:10:42 -0500
Return-Path: <mackay>
Received: (mackay@localhost) by june.cs.washington.edu (8.6.9/7.2ju) id MAA02402; Wed, 28 Dec 1994 12:10:39 -0800
Date: Wed, 28 Dec 1994 12:10:39 -0800
From: mackay@cs.washington.edu (Pierre MacKay)
Message-Id: <199412282010.MAA02402@june.cs.washington.edu>
To: tex-k@cs.umb.edu, mackay@cs.washington.edu
Subject: A little test driver for kpathsea
/*
* I've found this little driver for Karl Berry's kpathsea
* library pretty useful. It gives a feeling of exactly what
* delays are involved in the use of the kpathsea search stratagem
* (they are a lot less than you think they are)
* and makes debugging an environment a lot easier. The only
* trick you have to remember is that pk fonts (and any similar
* files with mode specifications) need to be called with the
* mode directory. "cmr10.300pk" will be reported as null, but
* "cx/cmr10.300pk" will find the file. (This is explained in
* the standard texmf.cnf file.)
*
* Typical usage: kpsewhich PKFONTS
* then respond to the "Filename:" prompt
* Exit with "q" or "quit"
*
* cc -c -I<kpsepath> -I<kpsepath>/kpathsea kpsewhich.c
* cc -o kpsewhich kpsewhich.o <kpsepath>/kpathsea/kpathsea.a
*
* <kpsepath> is a path to wherever the kpathsea source directory
* is---it is assumed that kpathsea.a has already been made
*
* Pierre Mackay Wed Dec 28 12:01:59 PST 1994 mackay@cs.washington.edu
*/
#include <stdio.h>
#include <sys/param.h>
#include <kpathsea/config.h>
#include <kpathsea/tex-file.h>
#include <kpathsea/tex-make.h>
main(argc, argv)
int argc;
char* argv[];
{
char buf[100];
char *path;
kpse_file_format_type kpsewhich_type;
kpsewhich_type = kpse_tex_format;
if (argc > 1) {
if ((strcmp(argv[1], "?") == 0) || (strcmp(argv[1], "help")) == 0) {
printf
( "Usage: kpsewhich <format_type> where format_type = one of\n");
printf
( "PKFONTS GFFONTS GLYPHFONTS\n");
printf
( "TEXINPUTS MFINPUTS TEXFORMATS MFBASES\n");
printf
( "TEXPOOL MFPOOL TFMFONTS VFFONTS\n");
printf
( "BIBINPUTS BSTINPUTS TEXCONFIG DVIPSHEADERS\n");
printf
( "TEXMF_CNF and pseudo environments LATEX LATEX209\n");
exit(0);
}
if (strcmp(argv[1], "PKFONTS") == 0) {
kpsewhich_type = kpse_pk_format;
kpse_set_progname("dvips");
}
if (strcmp(argv[1], "GFFONTS") == 0) {
kpsewhich_type = kpse_gf_format;
kpse_set_progname("dvips");
}
if (strcmp(argv[1], "GLYPHFONTS") == 0) {
kpsewhich_type = kpse_any_glyph_format;
kpse_set_progname("dvips");
}
if (strcmp(argv[1], "TEXINPUTS") == 0) {
kpsewhich_type = kpse_tex_format;
kpse_set_progname("tex");
}
if (strcmp(argv[1], "MFINPUTS") == 0) {
kpsewhich_type = kpse_mf_format;
kpse_set_progname("mf");
}
if (strcmp(argv[1], "TEXFORMATS") == 0) {
kpsewhich_type = kpse_fmt_format;
kpse_set_progname("initex");
}
if (strcmp(argv[1], "MFBASES") == 0) {
kpsewhich_type = kpse_base_format;
kpse_set_progname("inimf");
}
if (strcmp(argv[1], "TEXPOOL") == 0) {
kpsewhich_type = kpse_texpool_format;
kpse_set_progname("initex");
}
if (strcmp(argv[1], "MFPOOL") == 0) {
kpsewhich_type = kpse_mfpool_format;
kpse_set_progname("inimf");
}
if (strcmp(argv[1], "VFFONTS") == 0) {
kpsewhich_type = kpse_vf_format;
kpse_set_progname("dvips");
}
if (strcmp(argv[1], "TFMFONTS") == 0) {
kpsewhich_type = kpse_tfm_format;
kpse_set_progname("tex");
}
if (strcmp(argv[1], "BIBINPUTS") == 0) {
kpsewhich_type = kpse_bib_format;
kpse_set_progname("bibtex");
}
if (strcmp(argv[1], "BSTINPUTS") == 0) {
kpsewhich_type = kpse_bst_format;
kpse_set_progname("bibtex");
}
if (strcmp(argv[1], "TEXCONFIG") == 0) {
kpsewhich_type = kpse_dvips_config_format;
kpse_set_progname("dvips");
}
if (strcmp(argv[1], "DVIPSHEADERS") == 0) {
kpsewhich_type = kpse_dvips_header_format;
kpse_set_progname("dvips");
}
if (strcmp(argv[1], "TEXMF_CNF") == 0) {
kpsewhich_type = kpse_cnf_format;
kpse_set_progname("tex");
}
if (strcmp(argv[1], "LATEX") == 0) {
kpsewhich_type = kpse_tex_format;
kpse_set_progname("latex");
}
if (strcmp(argv[1], "LATEX209") == 0) {
kpsewhich_type = kpse_tex_format;
kpse_set_progname("latex209");
}
} else {
kpse_set_progname("tex");
printf("Using default TEXINPUTS setting.\n");
}
kpse_init_format(kpsewhich_type);
if (argc < 3) {
/* might want to put search targets on command line */
printf("Filename: ");
while (gets(buf) != NULL) {
if (( strcmp(buf,"q") == 0 ) || (strcmp(buf,"quit") == 0 )) exit(0);
path = kpse_find_file(buf,kpsewhich_type,0);
printf("%s -> %s\n", buf, path);
printf("Filename: ");
}
}
exit(0);
}
%=======================================================================%
| N O T I C E |
| The University of Washington has ordered us to close the Northwest |
| Computing Support Center, and to terminate the official support |
| of UnixTeX. Although the termination was final as of June 14, 1994 |
| I will continue unofficially to provide tape distributions and |
| any other services I can. Although I cannot be near my phone on any |
| regular schedule, I now have an answering machine. Please note |
| the changes in address and telephone number. There is no Northwest |
| Computing Support Center any longer. |
| |
%=======================================================================%
Email concerned with UnixTeX distribution software may be sent
To: mackay@cs.washington.edu Pierre A. MacKay
Smail: Department of Classics Emeritus Druid for
Denny Hall, Mail Stop DH-10 Unix-flavored TeX
University of Washington
Seattle, WA 98195
(206) 543-2268 (Message recorder now available)
*********************
Montlake Community College *Per ardua ad infima*
(formerly the University of Washington) *Per infima in fimum*
*********************